Typeset:

Retypeset the entire diagram using a hacked halign: its template typesets each entry as

|$\displaystyle \POS$| |"|"row"|,|"col"|"| |*| "object" || "$\displaystyle \XY$ - commands"||

where "object" is the contents of the entry translated into -pic <object> form and "-commands" entails the commands used in this particular entry.

( @@typeset#1@MATRIX TYPESET@ @ @@@ @@@@=@ @=@ @@@=@ @=@ @ @=@
==@ @##!@&&@@##!@#1@@@@ @@@@= )

Here are the template execution macros: We reset the |@| for each entry, || it the usual way except first all -commands are `redirected' to the queue, and then typeset them. We pass the min/max of the picture from one entry to the next using a global macro |@minmax|.

( @@@ne @=@ @@

@@minmax=

Again some parsing determines whether this is a |*|-object or a normal object:

( @@@@ne @##1,##2@@ENTRY "##1,##2"@=##1 @=##2 @minmax @##1,##2@@ @ @@@i

@@@i@ =@@norm @*@*##1##@@star##1 @

@@@star#1#2#3!@@@ix@#1#2@@@9@h@ @@=@ @=@ @ #3 @=@x

@@@norm#1!@@##1@@ix@ @##1@ @#1@@@9 @=@@ @@=@ @=@ @ #1 @=@x )

Dropping the entry is just retypesetting it at the right location again ignoring the -stuff:

( @@#1#2@#1@ @@=@ @=@ #2 )

The macros used for queuing are these; only the toks9 replacement is tricky; furthermore queueing is "not" done if we are saving because the effect will give the same result without risk of extremely long lines in the compiled file!

( @@@ @=@ @@ix@=@@toksix@ @=@ @@ix@=@@toksix@ @=@

@@#1#2@#2

@@@toksix@ @@toksix@i 9=

@@@toksix@i@##1@@9=##1@ 9

@@@ne @ )